package com.hantang.web.servlet;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import com.google.gson.Gson;
import com.hantang.web.json.ds.MetaData;
import com.hantang.web.json.res.StringRes;

public class UnkownUrlServlet extends BaseServlet{

	private static Logger logger = Logger.getLogger(UnkownUrlServlet.class);
	/**
	 * 
	 */
	private static final long serialVersionUID = -4850706500501948448L;

	@Override
	public int doService(HttpServletRequest request, PrintWriter out) {
		StringRes sres = new StringRes();
		logger.info("UnkownUrlHandler......");
		sres.setData("UnkownUrl");
		sres.setMeta(new MetaData(MetaData.META_DATA_ERROR_PARA, "Unkown URL"));
		Gson gson = new Gson();
		String sret = gson.toJson(sres);
		out.print(sret);
		
		return SERVLET_SUCCESS_CODE;
	}

	
}
